﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.Model;
using ZF.BLL;
using GCELibrary.Current;
using ZF.BLL.Linq;
using ZF.DAL;
using System.Web.UI.HtmlControls;
namespace ZF.WS.UserControls
{
    public partial class EstateInfo : System.Web.UI.UserControl
    {
    
        public H_Estate House { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
             
        }
        protected override void OnPreRender(EventArgs e)
        {
       

            var ps = House.Photo.EmptyString("").Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            if (ps.Length > 0)
            {
                this.lvImgList.DataSource = ps.Select(p => new { File = p }).ToList();
                this.lvImgList.DataBind();
            }
            else
            {
                this.tyPhoto.Visible = false;
            }



            base.OnPreRender(e);
        }
        public string City
        {
            get
            {
                return DictionaryConfig.HArea.DefaultIfEmpty(p => p.AreaId == House.AreaId1,
                    new Dic_Area() { Name = "其他" }).Name;
            }
        }
        public string Area
        {
            get
            {
                return DictionaryConfig.HArea.DefaultIfEmpty(p => p.AreaId == House.AreaId1,
                    new Dic_Area() { Name = "" }).Name;
            }
        }
 
    
    }
}